﻿#pragma execution_character_set("utf-8")

#include "line_checkbox.h"
#include <QCheckBox>
#include <QPushButton>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QtDebug>
#include <QLabel>
#include <QSpinBox>
#include <QLineEdit>
#include <QFile>
#include <QTextStream>


LineCheckBox::LineCheckBox(const QString strTitle, IMath *math, QWidget *parent)
    : QWidget(parent)
    , m_checkboxFun1(new QCheckBox(strTitle,this))
    , m_btnConfig1(new QPushButton(tr("配置"),this))
    , m_layout1(new QHBoxLayout())
    , m_math(math)
{
        m_btnConfig1->setFixedWidth(100);
        m_layout1->addWidget(m_btnConfig1);
        m_layout1->addWidget(m_checkboxFun1);
        setLayout(m_layout1);
        // 默认选中
        m_checkboxFun1->setChecked(true);

        connect(m_btnConfig1,&QPushButton::clicked,this,&LineCheckBox::soltClickConfigBtn);
}

QString LineCheckBox::fun()
{
    if(m_math){
        return   m_math->fun();
    }
    else{
        return "";
    }
}


bool LineCheckBox::isChecked()
{
    return m_checkboxFun1->isChecked();
}

void LineCheckBox::setChecked(bool status)
{
    m_checkboxFun1->setChecked(status);
}

void LineCheckBox::soltClickConfigBtn()
{
    emit sigClickConfigBtn();
}
